/**
 * 
 */
package pt.inescid.components.console.commands;

import pt.inescid.components.console.Console;

/**
 * @author Sergio Esteves (sesteves at gsd.inesc-id.pt)
 *
 */
public class ShowWorkTimeCommand extends Command {

	public static final String CMD_NAME = "show_work_time";
	
	public ShowWorkTimeCommand(Console console) {
		super(console);
	}
	
	@Override
	public void execute(String[] args) throws CommandException {
		int lboundHour = gridP2P.getLboundHour();
		int uboundHour = gridP2P.getUboundHour();
		if(lboundHour < 0)
			console.writeln("Time interval to perform work: Anytime");
		else
			console.writeln("Time interval to perform work: from " + lboundHour + 
					":00 to " + uboundHour + ":00");
	}

	@Override
	public String getCmdName() {
		return CMD_NAME;
	}

	@Override
	public String synopsis() {
		return CMD_NAME + SYNTAX_SEPARATOR +
			"shows the time interval to perform work";
	}

}
